<?php

$this->breadcrumbs = array(
	$model->label(2) => array('index'),
	GxHtml::valueEx($model),
);

$this->menu=array(
	array('label'=>Yii::t('app', 'List') . ' ' . $model->label(2), 'url'=>array('index')),
	array('label'=>Yii::t('app', 'Create') . ' ' . $model->label(), 'url'=>array('create')),
	array('label'=>Yii::t('app', 'Update') . ' ' . $model->label(), 'url'=>array('update', 'id' => $model->id)),
	array('label'=>Yii::t('app', 'Delete') . ' ' . $model->label(), 'url'=>'#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>Yii::t('app', 'Manage') . ' ' . $model->label(2), 'url'=>array('admin')),
);
?>

<h1><?php echo Yii::t('app', 'View') . ' ' . GxHtml::encode($model->label()) . ' ' . GxHtml::encode(GxHtml::valueEx($model)); ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data' => $model,
	'attributes' => array(
'id',
'name',
'short_description',
'full_description',
'course_code',
'cpd_hours',
'duration',
'start_time',
'end_time',
'location',
'seats',
'price',
'gst_inclusive:boolean',
'registration_close_date',
'create_time',
'update_time',
'delete_time',
'deleted:boolean',
array(
			'name' => 'program',
			'type' => 'raw',
			'value' => $model->program !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->program)), array('program/view', 'id' => GxActiveRecord::extractPkValue($model->program, true))) : null,
			),
array(
			'name' => 'courseType',
			'type' => 'raw',
			'value' => $model->courseType !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->courseType)), array('courseType/view', 'id' => GxActiveRecord::extractPkValue($model->courseType, true))) : null,
			),
	),
)); ?>

<h2><?php echo GxHtml::encode($model->getRelationLabel('users')); ?></h2>
<?php
	echo GxHtml::openTag('ul');
	foreach($model->users as $relatedModel) {
		echo GxHtml::openTag('li');
		echo GxHtml::link(GxHtml::encode(GxHtml::valueEx($relatedModel)), array('user/view', 'id' => GxActiveRecord::extractPkValue($relatedModel, true)));
		echo GxHtml::closeTag('li');
	}
	echo GxHtml::closeTag('ul');
?><h2><?php echo GxHtml::encode($model->getRelationLabel('courseRegistrations')); ?></h2>
<?php
	echo GxHtml::openTag('ul');
	foreach($model->courseRegistrations as $relatedModel) {
		echo GxHtml::openTag('li');
		echo GxHtml::link(GxHtml::encode(GxHtml::valueEx($relatedModel)), array('courseRegistration/view', 'id' => GxActiveRecord::extractPkValue($relatedModel, true)));
		echo GxHtml::closeTag('li');
	}
	echo GxHtml::closeTag('ul');
?>